﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using WeifenLuo.WinFormsUI.Docking;
//using _180FrameWork.Common;

namespace _180FrameWork.CustControls
{
    public partial class CustDockpanel : DockPanel
    {
        public CustDockpanel()
        {
            InitializeComponent();
            this.Skin.DockPaneStripSkin.DocumentGradient.DockStripGradient.EndColor = colorHx16toRGB("#eeeeee");
            this.Skin.DockPaneStripSkin.DocumentGradient.DockStripGradient.StartColor = colorHx16toRGB("#99bbe8");
            this.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.StartColor = colorHx16toRGB("#dae7f6");
            this.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.EndColor = colorHx16toRGB("#dae7f6");

        }

        public static System.Drawing.Color colorHx16toRGB(string strHxColor)
        {
            try
            {
                if (strHxColor.Length == 0)
                {
                    //如果为空
                    return System.Drawing.Color.FromArgb(0, 0, 0);//设为黑色
                }
                else
                {
                    //转换颜色
                    return System.Drawing.Color.FromArgb(System.Int32.Parse(strHxColor.Substring(1, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(3, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(5, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
                }
            }
            catch
            {
                //设为黑色
                return System.Drawing.Color.FromArgb(0, 0, 0);
            }
        }
    }
}
